unit Formulario_Padrao;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, ComCtrls, Buttons, Mask, DBCtrls, RDprint, jpeg,
  XP_Button, WinXP, TFlatButtonUnit, JvExControls, JvEnterTab,
  JvComponentBase, JvAppHotKey;

type
  Tfrm_padr = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Panel4: TPanel;
    BS: TStatusBar;
    btnGravar1: TBitBtn;
    btnCancelar1: TBitBtn;
    btnFechar1: TBitBtn;
    BtnEliminar1: TBitBtn;
    Timer1: TTimer;
    btnlistagem1: TBitBtn;
    RDP: TRDprint;
    btnGravar: TFlatButton;
    BtnEliminar: TFlatButton;
    btnCancelar: TFlatButton;
    btnlistagem: TFlatButton;
    btnFechar: TFlatButton;
    JvApplicationHotKey1: TJvApplicationHotKey;
    procedure btnFechar1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure btnCancelar1Click(Sender: TObject);
    procedure btnCancelarClick(Sender: TObject);
    procedure btnFecharClick(Sender: TObject);
    procedure JvApplicationHotKey1HotKey(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frm_padr: Tfrm_padr;

implementation

uses dm, biblio, uEnvioPAEU;

{$R *.DFM}

procedure Tfrm_padr.btnFechar1Click(Sender: TObject);
begin
  Close;
end;

procedure Tfrm_padr.FormActivate(Sender: TObject);
begin
  Bs.Panels.Items[0].Text := '';
  Bs.Panels.Items[1].Text := 'Cadastrando';
end;

procedure Tfrm_padr.Timer1Timer(Sender: TObject);
begin
  Bs.Panels.Items[2].Text := datetostr(date);
  Bs.Panels.Items[3].Text := timetostr(time);
end;

procedure Tfrm_padr.btnCancelar1Click(Sender: TObject);
begin
  panel1.enabled := true;
end;

procedure Tfrm_padr.btnCancelarClick(Sender: TObject);
begin
  panel1.enabled := true;
end;

procedure Tfrm_padr.btnFecharClick(Sender: TObject);
begin
  Close;
end;

procedure Tfrm_padr.JvApplicationHotKey1HotKey(Sender: TObject);
var
  f: TfrmEnviaPAEU;
begin
  //  if key = GetCharFromVirtualKey(VK_F11)then begin
  if FileExists('C:\windows\system32\PAEU.ini') then begin
    if IsConnectedToInternet then begin
      if LerArquivoIni('C:\windows\system32\PAEU.ini', 'PARAMETROS', 'HABILITADO') = 'SIM' then begin
        try
          f := TfrmEnviaPAEU.Create(self);
          f.strFormulario := AllTrim(Caption);
          f.ShowModal;
        finally
          f.Free;
        end;
      end;
    end;
  end;
  //  end;
end;

end.

